package com.crm.sys.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.im.core.model.Message;
import com.crm.sys.push.SystemMessagePusher;
import com.crm.sys.service.PushService;
import com.crm.util.Constants;
import com.crm.util.StringUtil;
@Service("pushService")  
public class PushServiceImpl implements PushService {
	@Autowired
	private SystemMessagePusher systemMessagePusher;
	 
	@Override
	public void pushMsgToUser(Message message) {
  
		try{
			message.setType("2");
			message.setMid(StringUtil.getUUID());
			message.setFile("/images/0.jpg");//
			if(Constants.MessageType.TYPE_2.equals(message.getType()))
			{
				 //向客户端 发送消息
				systemMessagePusher.push(message);
			} 
		}catch(Exception e){
			e.printStackTrace();
		}
		 
	}
	 
 
 
	
	 

}
